package com.jming.helloworld.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jming.helloworld.model.User;

@RestController
@RequestMapping("/api")

public class HelloController {
	@GetMapping("/hello")
	public String sayhello() {
		return "hello world";
	}

	@GetMapping("/test")
	public String test() {
		throw new RuntimeException("出现一个异常");
	}

	@RequestMapping("login")
	public String login() {
		Object obj = null;
		System.out.println(obj.hashCode());
		return "这里是login";
	}

	@GetMapping("/success")
	public Integer success() {
		// 这个方法会返回一个简单的字符串
		return 123456;
	}
}
